<?
	$sanpham=$t->get_by_thutu("sanpham",-1,1," and ($ngaynay < thoigianden)","limit 0,1");
	$row_so_top=mysql_fetch_assoc($sanpham);
	
	$idloai=$row_so_top['idloai'];
	$loai=$t->get_by_thutu("sanpham_loai",$idloai);
	$row_loai=mysql_fetch_assoc($loai);
	if($row_loai['ten_'.$lang]=='') $row_loai['ten_'.$lang]='-';
	
	$images=explode(":*:",$row_so_top['url_img']);
?>
<div id="sanpham_moi">
	<div id="title_sp_moi">
    	<div style="background:url(images/bg_cp_left.png);width:23px;height:50px;float:left;"></div>
        <div style="background:url(images/bg_cp_center.png);height:50px;float:left;line-height:50px;padding:0px 5px;">
        <h1><?=$row_so_top['ten_'.$lang]?></h1>
        </div>
        <div style="background:url(images/bg_cp_right.png);width:23px;height:50px;float:left;"></div>
    </div>
    <div style="width:580px;float:left;margin-left:15px;margin-top:65px;">
    	<div style="float:left;width:580px;">
        	<div class="deal_image">
            <? if($images[0]!=''){?>
            	<img src="<?=$images[0]?>" width="270" />
			<? }?>
            </div>
            <div class="deal_info">
            <?=$row_so_top['giamgia_mota']?>
            </div>
        </div>
        <div style="float:left;width:580px;margin-top:5px;">
        	<div class="deal_bottom_left">
            <h2>Giảm <span style="font-size:22px;font-weight:bold;"><?=$row_so_top['giamgia']?>%</span> trên tổng hóa đơn</h2>
            <h2>Thời gian chấp nhận thẻ từ<span style="color:#fc7700;"><?=date("d/m/Y/",$row_so_top['thoigiantu']);?></span> đến<span style="color:#fc7700;"><?=date("d/m/Y/",$row_so_top['thoigianden']);?></span></h2>
            </div>
            <div class="deal_bottom_right">
            <a href="<?=$rooturl?><?=$list['3']['alias'];?>/<?=convert($row_loai['ten_'.$lang])?>/<?=convert($row_so_top['ten_'.$lang])?>-<?=$row_so_top['id']?>.html">
            <img src="images/bg_xemngay.png" />
            </a>
            </div>
        </div>
    </div>
</div>